﻿using SqlSugar;

namespace Benefactor.Models.DbModels;

[SugarTable("eb_order_detail")]
public class CrmebOrderDetail
{
    [SugarColumn(ColumnName = "id", IsIdentity = true, IsPrimaryKey = true)]
    public int Id { get; set; }

    [SugarColumn(ColumnName = "mer_id", IsNullable = false)]
    public int MerchantId { get; set; }

    [SugarColumn(IsNullable = false, ColumnName = "order_no")]
    public string OrderNo { get; set; }

    [SugarColumn(IsNullable = false, ColumnName = "product_id")]
    public int ProductId { get; set; }

    [SugarColumn(IsNullable = false, ColumnName = "uid")]
    public int UserId { get; set; }

    [SugarColumn(IsNullable = false, ColumnName = "pay_price")]
    public double PayPrice { get; set; }

    [Navigate(NavigateType.OneToOne, 
        nameof(OrderNo), nameof(CrmebOrder.OrderNo))]
    public CrmebOrder? Order { get; set; }
}